const express = require("express")
const Staff = require("../models/staff")
const MemberInfo = require("../models/meberInfo")
const router = express.Router()
// 员工信息录入
router.post("/staff", async (req, res) => {
    await Staff.create(req.body)
    res.end("员工信息录入成功")
})
// 所有员工信息查询
router.get("/staff_info", async (req, res) => {
    const result = await Staff.find({}, {
        _id: 0,
        __v: 0
    })
    res.send(result)
})
router.post("/status", async(req, res) => {

    await MemberInfo.updateOne({member_id:req.body.member_id},{$set:{member_status:req.body.member_status}})
    res.send("挂失成功")
})
module.exports = router